<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ include file="/WEB-INF/common/common.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta charset="utf-8">
  <title>添加表格</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <link rel="stylesheet" href="<%=path %>/layui/css/layui.css">
  <link rel="stylesheet" href="<%=path %>/layui/css/lxq.css">
    <script type="text/javascript" src="<%=path %>/layui/jquery-3.3.1.min.js"></script>
    <script type="text/javascript" src="<%=path %>/layui/layui.js" charset="utf-8"></script>
</head>
<body>
<div class="lxq-body">
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
  <legend>添加表格</legend>
</fieldset>
 <form class="layui-form" action="<%=basePath%>/biz/Main_formToTopic.action" method="post" id="data_form">
  <div class="layui-row layui-col-space10">
		
		  <div class="layui-form-item">
		    <label class="layui-form-label">表格名</label>
		    <div class="layui-input-block">
		      <input type="text" name="formName" required  lay-verify="required" placeholder="请输入表格名" autocomplete="off" class="layui-input">
		    </div>
		  </div>
		
		  <div class="layui-form-item">
		    <label class="layui-form-label">表格状态</label>
		    <div class="layui-input-block">
		    	<input type="radio" name="formState" value="0" title="关闭" checked>
		      	<input type="radio" name="formState" value="1" title="发布">
		    </div>
		  </div>
		  
		  <div class="layui-form-item">
		    <label class="layui-form-label">表格类型</label>
		    <div class="layui-input-block">
		      <input type="radio" name="formType" value="0" title="普通表格" checked>
		      <input type="radio" name="formType" value="1" title="信息复核">
		      <input type="radio" name="formType" value="2" title="重复回收" >
		    </div>
		  </div>

			<div class="layui-form-item">
		      <label class="layui-form-label">开始时间</label>
		      <div class="layui-input-block">
		        <input type="text" name="startTime" id="startDate" placeholder="开始时间" autocomplete="off" class="layui-input">
		      </div>
		   </div>
		  
	      <div class="layui-form-item">
		      <label class="layui-form-label">截止时间</label>
		      <div class="layui-input-block">
		        <input type="text" name="endTime" id="endDate" placeholder="截止时间" autocomplete="off" class="layui-input">
		      </div>
		   </div>
		   
		   
	     <div class="layui-form-item layui-form-text">
		    <label class="layui-form-label">备注</label>
		    <div class="layui-input-block">
		      <textarea name="remark" placeholder="请输入备注" class="layui-textarea"></textarea>
		    </div>
		  </div>
		  
		  
	    <div class="layui-form-item">
		    <div class="layui-input-block">
		    <button class="layui-btn" class="layui-btn layui-btn-primary">导入模板</button>
		      <button class="layui-btn" lay-submit lay-filter="sb">确认提交</button>
		      
		    </div>
		  </div>
		

    
    
  
  </div>    
          
</form>
 </div>
<script>
layui.use(['form', 'layedit', 'laydate','table'], function(){
  var form = layui.form
  ,table = layui.table
  ,layer = layui.layer
  ,layedit = layui.layedit
  ,laydate = layui.laydate;
  
  //日期
  laydate.render({
    elem: '#startDate'
    ,type: 'datetime'
    ,format: 'yyyy-MM-dd HH:mm'
  });

  laydate.render({
    elem: '#endDate'
    ,type: 'datetime'
    ,format: 'yyyy-MM-dd HH:mm'
	});
  
  //创建一个编辑器
  var editIndex = layedit.build('LAY_demo_editor');
 
  //自定义验证规则
  form.verify({
    title: function(value){
      if(value.length < 5){
        return '标题至少得5个字符啊';
      }
    }
    ,pass: [/(.+){6,12}$/, '密码必须6到12位']
    ,content: function(value){
      layedit.sync(editIndex);
    }
  });
  

  
  //监听提交
  form.on('submit(sb)', function(data){
    return true;
  });
 

});
</script>

</body>
</html>